package com.qianfeng.smartdevice.pojo;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import org.springframework.util.StringUtils;

import java.util.List;

public class User implements CheckNull {

    private Long id;
    private String username;
    @JsonIgnore //不仅仅是返回不展示,接收的时候也不会解析
    private String password;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date lastlogin;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date currentlogin;
    private String type;
    private String status;
    private String data2;
    private String data1;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private java.util.Date regdate;

    private List<Role> roleList;

    public void setRoleList(List<Role> roleList) {
        this.roleList = roleList;
    }

    public List<Role> getRoleList() {
        return roleList;
    }

    @Override
    public boolean isNull() {
        return StringUtils.isEmpty(username) || StringUtils.isEmpty(password);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }


    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    public java.util.Date getLastlogin() {
        return lastlogin;
    }

    public void setLastlogin(java.util.Date lastlogin) {
        this.lastlogin = lastlogin;
    }


    public java.util.Date getCurrentlogin() {
        return currentlogin;
    }

    public void setCurrentlogin(java.util.Date currentlogin) {
        this.currentlogin = currentlogin;
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public String getData2() {
        return data2;
    }

    public void setData2(String data2) {
        this.data2 = data2;
    }


    public String getData1() {
        return data1;
    }

    public void setData1(String data1) {
        this.data1 = data1;
    }


    public java.util.Date getRegdate() {
        return regdate;
    }

    public void setRegdate(java.util.Date regdate) {
        this.regdate = regdate;
    }

}
